package utilities;

public class Rounding {
   public static float round(float Rval, int Rpl) {
	  float p = (float)Math.pow(10, Rpl);
	  Rval = Rval * p;
	  float tmp = Math.round(Rval);
	  return (float)tmp/p;
   }
   public static double round(double Rval, int Rpl){
	  double p = (double)Math.pow(10, Rpl);
	  Rval = Rval * p;
	  double tmp = Math.round(Rval);
	  return (double)tmp/p;
   }
}

/*	  public static void main(String[] args) {
	    float num = 2.954165f;
	    float round = Round(num,2);
	    System.out.println("Rounded data: " + round);
	  } */

